package com.group.transaction.service.product.impl;

import com.alibaba.fastjson.JSONObject;
import com.group.transaction.domain.Product;
import com.group.transaction.mapper.ProductMapper;
import com.group.transaction.service.product.ProductService;
import org.springframework.stereotype.Service;

import java.beans.Transient;

@Service
public class ProductServiceImpl implements ProductService {

    private ProductMapper productMapper;

    /**
     *添加产品th
     * @return
     */
    @Override
    @Transient
    public JSONObject addProduct(Product product) {
        return new JSONObject().fluentPut("result",productMapper.insert(product));
    }

    /**
     * 编辑产品
     * @return
     */
    @Override
    public JSONObject compileProdduct(Product product) {
        return new JSONObject().fluentPut("result",productMapper.updateByPrimaryKey(product));
    }

    /**
     * 删除产品
     * @return
     */
    @Override
    public JSONObject deleteProduct(Product product) {
        return new JSONObject().fluentPut("result",productMapper.delete(product));
    }

    /**
     * 查询产品
     * @return
     */
    @Override
    public JSONObject queryProductData(Product product) {
        return new JSONObject().fluentPut("result",productMapper.delete(product));
    }

    /**
     * 查询产品详情
     * @return
     */
    @Override
    public JSONObject queryProductDetail(Integer productId) {
        return new JSONObject().fluentPut("result",productMapper.queryProductDetail(productId));
    }

    /**
     * 添加图片
     * @return
     */
    @Override
    public JSONObject addProductImage() {
        return new JSONObject().fluentPut("result","");
    }

    /**
     *  删除图片
     * @return
     */
    @Override
    public JSONObject deleteProductImage() {
        return new JSONObject().fluentPut("result","");
    }

    /**
     *  添加购物车
     * @return
     */
    @Override
    public JSONObject addCatShapping() {
        return new JSONObject().fluentPut("result","");
    }

    /**
     * 删除购物车
     * @return
     */
    @Override
    public JSONObject deleteCatShapping() {
        return new JSONObject().fluentPut("result","");
    }

    /**
     * 保存评价信息
     * @return
     */
    @Override
    public JSONObject addProductEvaluate() {
        return new JSONObject().fluentPut("result","");
    }

    /**
     * 删除评价信息
     * @return
     */
    @Override
    public JSONObject deleteProductEvaluate() {
        return new JSONObject().fluentPut("result","");
    }

    /**
     * 添加订单
     * @return
     */
    @Override
    public JSONObject addOrder() {
        return new JSONObject().fluentPut("result","");
    }

    /**
     * 编辑订单
     * @return
     */
    @Override
    public JSONObject compileOrder() {
        return new JSONObject().fluentPut("result","");
    }

    /**
     * 删除订单
     * @return
     */
    @Override
    public JSONObject deleteOrder() {
        return new JSONObject().fluentPut("result","");
    }

    /**
     * 查询历史订单
     * @return
     */
    @Override
    public JSONObject queryHistoryOrder() {
        return new JSONObject().fluentPut("result","");
    }

    /**
     * 添加产品类型
     * @return
     */
    @Override
    public JSONObject addProductType() {
        return new JSONObject().fluentPut("result","");
    }

    /**
     * 编辑产品类型
     * @return
     */
    @Override
    public JSONObject compileProductType() {
        return new JSONObject().fluentPut("result","");
    }

    /**
     * 保存产品类型
     * @return
     */
    @Override
    public JSONObject deleteProductType() {
        return new JSONObject().fluentPut("result","");
    }
}
